$('#new_event_form').live('submit',function (event){
	//if no internet, alert, cancel submition
	event.preventDefault();
	return false;
});


function fill_my_location(){
	if(navigator.geolocation) {
		window.plugins.loadingIndicator.show();
		//initialize geocoder
		var geocoder = new google.maps.Geocoder();
		navigator.geolocation.getCurrentPosition(function(position) {
			var pos = new google.maps.LatLng(position.coords.latitude,
										 position.coords.longitude);
			var address = '';
			geocoder.geocode({
				latLng: pos
			}, function(responses) {
				if (responses && responses.length > 0) {
					address = responses[0].formatted_address;
					$('#location').val(address);
					window.plugins.loadingIndicator.hide();
				} else {
					console.log('Cannot determine address at this location.');
				}
			});

			
		}
		
		
		);
	}else{
		alert('Please turn on geolocation services');
	}
}